//
//  ItemEditViewController.h
//  iFlickr
//
//  Created by 张 霄鹤 on 09-6-6.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UploadItem.h"
#import "UploadViewController.h"


@interface ItemEditViewController : UITableViewController<UITableViewDelegate,UITextFieldDelegate>{
	UploadItem *editItem;
	IBOutlet UIBarButtonItem *doneButton;
	
	//IBOutlet UIImageView *imgView;
	//IBOutlet UITableViewCell *imgCell;
	
	IBOutlet UITableViewCell *titleCell;
	IBOutlet UITableViewCell *descriptCell;
	IBOutlet UITableViewCell *tagsCell;
	IBOutlet UITableViewCell *publicCell;
	IBOutlet UITableViewCell *friendCell;
	IBOutlet UITableViewCell *familyCell;
	
	IBOutlet UITextField *txtTitle;
	IBOutlet UITextField *txtDescription;
	IBOutlet UITextField *txtTags;
	
	IBOutlet UISwitch *sPublic;
	IBOutlet UISwitch *sFriend;
	IBOutlet UISwitch *sFamily;
	
	UploadViewController *uvc;
}

@property(nonatomic, retain) UploadItem *editItem;

@property(nonatomic, retain) UploadViewController *uvc;

/**
 * 按钮事件，保存修改，直接操作 editItem 会将原始的item修改的
 */
-(IBAction)saveEditItem:(id)sender;

/**
 * switch点击，根据不同的点击进行权限的控制
 */
-(IBAction)clickSwitch:(id)sender;

// 因为在 UploadViewController 中已经提供了 Delete操作，因此不需要提供了，只有保存即可

///**
// * 获得图片预览Cell
// */
//- (UITableViewCell *)getImageCell:(NSInteger)row;

/**
 * 获取前3个cell
 */
-(UITableViewCell *)getDescriptionCell:(NSInteger)row;

/**
 * 获取访问权限的3个 Cell
 */
-(UITableViewCell *)getAccessCell:(NSInteger)row;

#pragma mark -
#pragma mark UITextFieldDelegate Impl
/**
 * 点击Return key时候作的处理
 */
- (BOOL)textFieldShouldReturn:(UITextField *)textField;

@end
